#delimit;
clear all;

use "Inc_Adv_House_CS.dta", replace;

reg Inc_Adv mrp_esti mrp_sq, robust;
reg Inc_Adv dist_mean_ideol dist_mean_ideol_sq, robust;
reg Inc_Adv rep_vs rep_vs_sq, robust;

twoway (scatter Inc_Adv dist_mean_ideol) (qfit Inc_Adv dist_mean_ideol), ytitle("Estimated District Incumbency Advantage") xtitle("Mean District CCES Respondent Ideology") xlabel(-0.25[0.1]0.25)  graphregion(color(white)) bgcolor(white);
graph export house_incadv_cces_nolabel.eps, replace;
twoway (scatter Inc_Adv mrp_esti) (qfit Inc_Adv mrp_esti), ytitle("Estimated District Incumbency Advantage") xtitle("District MRP Ideology") graphregion(color(white)) bgcolor(white);
graph export house_incadv_mrp_nolabel.eps, replace;

twoway (scatter Inc_Adv rep_vs, mlabels(distidrunfor)) (qfit Inc_Adv rep_vs), ytitle("Estimated District Incumbency Advantage") xtitle("District Average Rep. President Vote Share") graphregion(color(white)) bgcolor(white);
graph export house_incadv_repvs.eps, replace;

corr mrp_esti dist_mean_ideol;
scatter mrp_esti dist_mean_ideol, ytitle("Estimated District Ideology (T-W's MRP)") xtitle("Mean District CCES Respondent Ideology") graphregion(color(white)) bgcolor(white) ;
graph export mrp_v_cces_house.eps, replace;


#delimit;
clear all;
use "Inc_Adv_ExpChall_House_CS.dta", replace;

reg Inc_Adv mrp_esti mrp_sq, robust;
reg Inc_Adv dist_mean_ideol dist_mean_ideol_sq, robust;
reg Inc_Adv rep_vs rep_vs_sq, robust;

twoway (scatter Inc_Adv dist_mean_ideol) (qfit Inc_Adv dist_mean_ideol), ytitle("Estimated District Incumbency Advantage") xtitle("Mean District CCES Respondent Ideology") xlabel(-0.25[0.1]0.25)  graphregion(color(white)) bgcolor(white);
graph export house_incadvExp_cces_nolabel.eps, replace;
twoway (scatter Inc_Adv mrp_esti) (qfit Inc_Adv mrp_esti), ytitle("Estimated District Incumbency Advantage") xtitle("District MRP Ideology") graphregion(color(white)) bgcolor(white);
graph export house_incadvExp_mrp_nolabel.eps, replace;

twoway (scatter Inc_Adv rep_vs, mlabels(distidrunfor)) (qfit Inc_Adv rep_vs), ytitle("Estimated District Incumbency Advantage") xtitle("District Average Rep. President Vote Share") graphregion(color(white)) bgcolor(white);
graph export house_incadvExp_repvs.eps, replace;


#delimit;
clear all;
use "Inc_Adv_Senate_CS.dta", replace;
reg Inc_Adv mrp_esti mrp_sq, robust;
reg Inc_Adv state_mean_ideol state_mean_ideol_sq, robust;
reg Inc_Adv rep_vs rep_vs_sq, robust;

scatter mrp_esti state_mean_ideol, ytitle("Estimated State Ideology (T-W's MRP)") xtitle("Mean State CCES Respondent Ideology") graphregion(color(white)) bgcolor(white); 
graph export mrp_v_cces_senate.eps, replace;
corr mrp_esti state_mean_ideol;

scatter Inc_Adv mrp_esti, mlabels(stateab);

twoway (scatter Inc_Adv state_mean_ideol, mlabels(state_ab)) (qfit Inc_Adv state_mean_ideol), ytitle("Estimated State Incumbency Advantage") xtitle("Mean State CCES Respondent Ideology") xlabel(-0.25[0.1]0.25) graphregion(color(white)) bgcolor(white);
graph export senate_incadv_cces.eps, replace;
twoway (scatter Inc_Adv mrp_esti, mlabels(state_ab)) (qfit Inc_Adv mrp_esti), ytitle("Estimated State Incumbency Advantage") xtitle("State MRP Ideology") graphregion(color(white)) bgcolor(white);
graph export senate_incadv_mrp.eps, replace;

